package servlet.user;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sql.User;


@WebServlet("/manageuser")
public class ManageUser extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    
    public ManageUser() {
        super();
        
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		String level = (String)request.getSession().getAttribute("level");
		
		User user = new User();
		List userlist = user.listUser(level);
		
		request.setAttribute("userlist", userlist);
		request.getRequestDispatcher("manageuser.jsp").forward(request, response);;
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doGet(request, response);
	}

}
